<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>open new world</title>
    <link rel="stylesheet" href="./css/common.css">
    <link rel="shortcut icon" href="./bitbug_favicon.ico" />

    <style>
        body {
            background-color: #050801;
            display: flex;
            flex-direction: column;
            justify-content: center;
            min-height: 100vh;
            align-items: center;

        }

        div {
            width: 640px;
            height: 640px;
            position: relative;

        }

        input {
            width: 40px;
            height: 40px;
            border: 2px solid #2aa1f1;
            box-shadow: 0 0 5px #2aa1f1, 0 0 25px #2aa1f1, 0 0 50px #2aa1f1, 0 0 200px #2aa1f1;
            cursor: pointer;
            background-color: #050801;
            color: #2aa1f1;
            position: absolute;
            transform: translate(300px, 300px);
            border-radius: 50%;

        }

        a {
            color: #2aa1f1;
            width: 640px;
            height: 640px;
            text-align: center;
            line-height: 640px;
            position: absolute;
            font-weight: bolder;
            font-size: 30px;
            display: inline-block;
            text-shadow: 0 0 5px #74c214, 0 0 25px #74c214, 0 0 50px #74c214, 0 0 200px #74c214;
            text-transform: uppercase;
            user-select: none;
            cursor: pointer;
        }

        .rotate {
            animation-name: rotate;
            animation-duration: 2.5s;
            animation-timing-function: ease;
            animation-fill-mode: forwards;
        }

        @keyframes rotate {
            from {
                transform: rotate(0deg);
                transform: translate(300px, 300px);
            }

            to {
                transform: rotate(180deg);
                width: 640px;
                height: 640px;

            }
        }


        .respone {
            animation-name: rotate1;
            animation-timing-function: ease;
            animation-fill-mode: forwards;
            animation-duration: 2s;
        }

        @keyframes rotate1 {
            from {
                transform: rotate(180deg);
            }

            to {
                transform: rotate(0deg);
                width: 40px;
                height: 40px;
                transform: translate(300px, 300px);
            }
        }
    </style>
</head>

<body>
    <!-- 欢迎界面 -->
    <div>
        <input type="button"></input>
    </div>

    <script>
        var btn = document.querySelector('input');
        var div = document.querySelector('div');
        var timer = null;
        function debounceChange() {
            timer = setTimeout(function () {
                btn.disabled = true;
                console.log(btn.disabled);
                function respone() {
                    btn.className = 'respone';
                    div.removeChild(div.children[1]);
                }
                function recover() {
                    btn.style.width = 40 + 'px';
                    btn.style.height = 40 + 'px';
                }
                function btn1() {
                    btn.disabled = false;
                }
                setTimeout(respone, 10000);
                setTimeout(recover, 12000);
                setTimeout(btn1, 13000);
            }, 100);
        }
        btn.onclick = function () {
            clearTimeout(timer);
            btn.className = 'rotate';
            function btnstyle() {
                btn.style.width = 640 + 'px';
                btn.style.height = 640 + 'px';
                var a = document.createElement('a');
                div.appendChild(a);
                a.innerText = 'open my world';
                div.children[1].onclick = function () {
                    div.children[1].href = './index/leap.html';
                }
            }
            setTimeout(btnstyle, 2500);
            debounceChange();

        }

    </script>
</body>

</html>